import request from '@/axios'

//获取列表数据
export const getListApi = (params?: any) => {
  return request.get({ url: '/admin/wholesalOrder', params })
}
//获取枚举数据
export const getEnumApi = (params?: any) => {
  return request.get({ url: '/admin/wholesalOrder/resource', params })
}
//获取商品（库存）枚举数据
export const getInventoryEnumApi = (params?: any) => {
  return request.get({ url: '/admin/inventory/resource', params })
}
//获取商品（库存）列表数据
export const getInventoryListApi = (params?: any) => {
  return request.get({ url: '/admin/inventory/merge', params })
}
//获取商品（库存）列表数据
export const selectWarehouseProducts = (params?: any) => {
  return request.get({ url: '/admin/order/selectWarehouseProducts', params })
}
//获取（客户）列表数据
export const getCustomerListApi = (params?: any) => {
  return request.get({ url: '/admin/customer', params })
}
//审核通过
export const approvedDataApi = (id: string | number, data?: Record<string, any>) => {
  return request.put({ url: `/admin/wholesalOrder/examine/${id}`, data })
}
//获取回显数据
export const getDetailApi = (id: string | number, params?: any) => {
  return request.get({ url: `/admin/wholesalOrder/${id}`, params })
}
//复制订单
export const copyWholesalOrderApi = (id: string | number): any => {
  return request.get({ url: `/admin/wholesalOrder/copy/${id}` })
}
//批量删除
export const delDataApi = (data) => {
  return request.delete({ url: `/admin/wholesalOrder`, data })
}
//新增参数配置
export const createDataApi = (data) => {
  return request.post({ url: '/admin/wholesalOrder', data })
}
//更新参数配置
export const editDataApi = (id: string | number, data) => {
  return request.put({ url: `/admin/wholesalOrder/${id}`, data })
}

//经销商订单-库存转换类型提交
export const inventoryTypeConversionApi = (data) => {
  return request.post({ url: '/admin/inventory/transSaveByWholesal', data })
}
//经销商订单-库存转换类型底部列表
export const getConversionListApi = (data: any) => {
  return request.post({ url: '/admin/order/getInventory', data })
}
//经销商订单-库存转换类型枚举
export const getConversionTypeApi = (params?: any) => {
  return request.get({ url: '/admin/order/transEnum', params })
}

export const orderCancelApi = (id: string | number, data?: any) => {
  return request.put({ url: `/admin/wholesalOrder/cancel/${id}`, data })
}
//经销商订单-库存类型转换详情
export const getInventoryConversionTypeApi = (params?: any) => {
  return request.get({ url: '/admin/order/inventory_trans_save_info', params })
}
